<!-- 登录拦截 -->
<script src="../assets/js/jquery.min.js"></script>
<script>
    var id = sessionStorage.getItem('userId')
    if (!id) {
        location.href = 'login.html'
    }
</script>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理-轮播图</title>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/admin/common.css">
    <link rel="stylesheet" href="/assets/css/admin/rotaion.css">
    <link rel="stylesheet" href="/assets/utils/nprogress/nprogress.css">
    <script src="/assets/utils/nprogress/nprogress.js"></script>
</head>

<body>
    <script>
        NProgress.start()
    </script>
    <!-- 1、左边导航栏区域 -->
    <div class="aside">
        <!-- 1-1-用户头像信息 -->
        <div class="user-info" id="userData">
            <img src="/assets/uploads/5.jpg" alt="">
            <h3>梦里百川</h3>
        </div>
        <!-- 1-2-菜单栏信息 -->
        <ul class="nav">
            <li>
                <a href="index.html"><span class="glyphicon glyphicon-equalizer"></span>首页</a>
            </li>

            <li>
                <a href="#menu-posts" class="collapsed" data-toggle="collapse">
                    <span class="glyphicon glyphicon-level-up"></span>文章<i class="glyphicon glyphicon-menu-down"></i>
                </a>
                <ul id="menu-posts" class="collapse">
                    <li><a href="allArticle.html">所有文章</a></li>
                    <li><a href="writeArticle.html">写文章</a></li>
                    <li><a href="catalogArticle.html">文章类别</a></li>
                </ul>
            </li>

            <li>
                <a href="comments.html"><span class="glyphicon glyphicon-equalizer"></span>评论</a>
            </li>
            <li>
                <a href="users.html"><span class="glyphicon glyphicon-equalizer"></span>用户</a>
            </li>
            <li class="active">
                <a href="#menu-settings" class="collapsed" data-toggle="collapse">
                    <span class="glyphicon glyphicon-equalizer"></span>设置<i class="glyphicon glyphicon-menu-down"></i>
                </a>
                <ul id="menu-settings" class="collapse in">
                    <li class="active"><a href="rotation.html">图片轮播</a></li>
                    <li><a href="settings.html">网站设置</a></li>
                </ul>
            </li>
        </ul>
    </div>
    <!-- 2、主体内容区域 -->
    <div class="main">
        <!-- 2-1-顶部小白条 -->
        <div class="navbar">
            <h3 class="title">轮播图设置</h3>
            <ul>
                <li><a href="resetPwd.html"><i class="glyphicon glyphicon-wrench"></i> 修改密码</a></li>
                <li><a href="login.html"><i class="glyphicon glyphicon-off"></i> 退出登录</a></li>
            </ul>
        </div>
        <!-- 2-2-主体内容 -->
        <div class="container-box">
            <!-- 2-2-1-添加轮播图 -->
            <div class="row">
                <div class="col-md-4">
                    <form id="addRota">
                        <h3>添加新轮播内容</h3>
                        <div class="form-group ">
                            <div class="banner-img">
                                <label for="file" class="input-img">
                                    <input type="file" id="file">
                                    <input type="hidden" name="image" id="rotaimg">
                                    <img src="../assets/uploads/3.jpg" alt="" id="rImg">
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="text">文本</label>
                            <input id="text" class="form-control" type="text" name="title" placeholder="文本">
                        </div>
                        <div class="form-group">
                            <label for="link">链接</label>
                            <input id="link" class="form-control" type="text" name="link" placeholder="链接">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary add" type="submit">添加</button>
                        </div>
                    </form>
                </div>
                <!-- 2-2-2-轮播图列表 -->
                <div class="col-md-8">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th class="text-center">图片</th>
                                <th>文本</th>
                                <th>链接</th>
                                <th class="text-center" width="100">操作</th>
                            </tr>
                        </thead>
                        <tbody>

                            <tr>
                                <td class="text-center"><img class="slide" src="/assets/uploads/5.jpg"></td>
                                <td>轮播图2号</td>
                                <td>http://localhost:3333/test</td>
                                <td class="text-center">
                                    <a href="javascript:;" class="btn btn-danger btn-ms">删除</a>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-center"><img class="slide" src="/assets/uploads/8.png"></td>
                                <td>轮播图1号</td>
                                <td>http://localhost:3333/test</td>
                                <td class="text-center">
                                    <a href="javascript:;" class="btn btn-danger btn-ms">删除</a>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-center"><img class="slide" src="/assets/uploads/2.jpeg"></td>
                                <td>轮播图2号</td>
                                <td>http://localhost:3333/test</td>
                                <td class="text-center">
                                    <a href="javascript:;" class="btn btn-danger btn-ms">删除</a>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-center"><img class="slide" src="/assets/uploads/4.jpg"></td>
                                <td>轮播图1号</td>
                                <td>http://localhost:3333/test</td>
                                <td class="text-center">
                                    <a href="javascript:;" class="btn btn-danger btn-ms">删除</a>
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>



    <!-- js -->
    <script src="../assets/js/jquery.min.js"></script>
    <script src="../assets/js/bootstrap.min.js"></script>
    <script src="../assets/utils/art-template/template-web.js"></script>
    <script src="../assets/js/common.js"></script>
    <script src="../assets/js/rotaion.js"></script>
    <!-- 轮播图列表模板-开始 -->
    <script type="text/html" id="rotaImgTpl">
        {{each data}}
        <tr>
            <td class="text-center"><img class="slide" src="{{$value.image}}"></td>
            <td>{{$value.title}}</td>
            <td>{{$value.link}}</td>
            <td class="text-center">
                <a href="javascript:;" class="btn btn-danger btn-ms deleteBtn" data-id="{{$value._id}}">删除</a>
            </td>
        </tr>
        {{/each}}
    </script>
    <!-- 轮播图列表模板-结束 -->
    <script>
        NProgress.done()
    </script>
</body>

</html>